/** 
 * Description:团购商品设置DAO
 * Date:2013-1-16
 * Author:Along	
*/
package com.community.shopping.dao;

import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.community.shopping.domain.GroupGoods;


public class GroupGoodsDao extends HibernateDaoSupport{
	private Log log = LogFactory.getLog(GroupGoodsDao.class);  
	

	public void save(GroupGoods groupGoods){
		getHibernateTemplate().saveOrUpdate(groupGoods);	
		log.debug("-------保存一行groupGoods-------");
	}

	public void delete(GroupGoods groupGoods){		  
		getHibernateTemplate().delete(groupGoods);
		log.debug("---------删除一行groupGoods-------");
	}

	public List<GroupGoods> getGroupGoods(String sql){
		String finalsql="from groupGoods where "+sql;
		return getHibernateTemplate().find(finalsql);
	}
	
	public GroupGoods getGroupGoods(Integer id){
		return getHibernateTemplate().load(GroupGoods.class, id);
	}
	}
